package org.pie.drawing.apps.picimageserver.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.CacheControl;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.concurrent.TimeUnit;

/**
 * @author zzj
 * @date 2024/09/18 15:24
 **/
@Configuration
public class ResourcesConfig  implements WebMvcConfigurer {
    @Value("${pic.profile}")
    private String profile;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        /** 本地文件上传路径 */
        registry.addResourceHandler( "/hpwData/**")
                .addResourceLocations("file:" + profile + "/");

    }
}
